const requireDirectory = require('require-directory')
const route = requireDirectory(module, './module')
const Router = require('koa-router')
const router = new Router()

Object.keys(route).map(key => {
    const routeObj = route[key]
    router.use(`/${key}`,routeObj.routes())
})

module.exports = router
